package com.thinkgsp.jxc.model;

import java.io.Serializable;
import java.math.BigDecimal;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import com.thinkgsp.util.XlsFieldAnnotation;
import com.thinkgsp.util.XlsValueType;

/**
 * 客户应收应付往来表
 * @author evan
 *
 */
public class RpCustomerContact extends BaseModel implements Serializable {

	private static final long serialVersionUID = 9108325717938744857L;
	
	@XlsFieldAnnotation(ChsName="客户",MethodName="getCustomer",RefType=XlsValueType.RefClass)
	private Customer customer;
	
	private Integer custSuppId;
	
	@XlsFieldAnnotation(ChsName="期初金额",MethodName="getBeginAmount")
	private BigDecimal beginAmount;
	
	@XlsFieldAnnotation(ChsName="应收金额",MethodName="getArecAmount")
	private BigDecimal arecAmount;
	
	@XlsFieldAnnotation(ChsName="已收金额",MethodName="getRecAmount")
	private BigDecimal recAmount;
	
	@XlsFieldAnnotation(ChsName="应付金额",MethodName="getApayAmount")
	private BigDecimal apayAmount;
	
	@XlsFieldAnnotation(ChsName="已付金额",MethodName="getPayAmount")
	private BigDecimal payAmount;
	
	@XlsFieldAnnotation(ChsName="余额",MethodName="getEndAmount")
	private BigDecimal endAmount;
	
	
	
	/**
	 * @return the custSuppId
	 */
	public Integer getCustSuppId() {
		return custSuppId;
	}

	/**
	 * @param custSuppId the custSuppId to set
	 */
	public void setCustSuppId(Integer custSuppId) {
		this.custSuppId = custSuppId;
	}

	/**
	 * @return the beginAmount
	 */
	public BigDecimal getBeginAmount() {
		return beginAmount;
	}

	/**
	 * @param beginAmount the beginAmount to set
	 */
	public void setBeginAmount(BigDecimal beginAmount) {
		this.beginAmount = beginAmount;
	}

	/**
	 * @return the arecAmount
	 */
	public BigDecimal getArecAmount() {
		return arecAmount;
	}

	/**
	 * @param arecAmount the arecAmount to set
	 */
	public void setArecAmount(BigDecimal arecAmount) {
		this.arecAmount = arecAmount;
	}

	/**
	 * @return the recAmount
	 */
	public BigDecimal getRecAmount() {
		return recAmount;
	}

	/**
	 * @param recAmount the recAmount to set
	 */
	public void setRecAmount(BigDecimal recAmount) {
		this.recAmount = recAmount;
	}

	/**
	 * @return the apayAmount
	 */
	public BigDecimal getApayAmount() {
		return apayAmount;
	}

	/**
	 * @param apayAmount the apayAmount to set
	 */
	public void setApayAmount(BigDecimal apayAmount) {
		this.apayAmount = apayAmount;
	}

	/**
	 * @return the payAmount
	 */
	public BigDecimal getPayAmount() {
		return payAmount;
	}

	/**
	 * @param payAmount the payAmount to set
	 */
	public void setPayAmount(BigDecimal payAmount) {
		this.payAmount = payAmount;
	}

	/**
	 * @return the endAmount
	 */
	public BigDecimal getEndAmount() {
		return endAmount;
	}

	/**
	 * @param endAmount the endAmount to set
	 */
	public void setEndAmount(BigDecimal endAmount) {
		this.endAmount = endAmount;
	}

	/**
	 * @return the customer
	 */
	public Customer getCustomer() {
		return customer;
	}

	/**
	 * @param customer the customer to set
	 */
	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	@Override
	public String toString() {
		ToStringBuilder sb = new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE);
		sb.append("custId",this.custSuppId)
		  .append("beginAmount",this.beginAmount)
		  .append("arecAmount",this.arecAmount)
		  .append("recAmount",this.recAmount)
		  .append("apayAmount",this.apayAmount)
		  .append("payAmount",this.payAmount)
		  .append("endAmount",this.endAmount);
		
		return sb.toString();
	}

	@Override
	public boolean equals(Object o) {
		if(this == o) {
			return true;
		}
		if(!(o instanceof RpCustomerContact)) {
			return false;
		}
		final RpCustomerContact cc = (RpCustomerContact)o;
		if(custSuppId != null) {
			return custSuppId.equals(cc.getCustSuppId());
		} else {
			return cc.getCustSuppId() == null;
		}
	}

	@Override
	public int hashCode() {
		return (this.custSuppId != null ? this.custSuppId.hashCode() : 0);
	}

}
